package com.itlong.cloud.enumerate;

import com.itlong.cloud.utils.words.StringHandlerUtil;

/**
 * <desc>
 *      物业住户管理中极光推送场景类型枚举
 * </desc>
 *
 * @createDate 2017-12-01
 */
public enum HouseHoldJPushSceneTypeEnum {
    HOUSEHOLD_J_PUSH_SCENE_TYPE_MOVE_IN("迁入", "1"),
    HOUSEHOLD_J_PUSH_SCENE_TYPE_MOVE_OUT("迁出", "2"),
    HOUSEHOLD_J_PUSH_SCENE_TYPE_FROZEN("冻结", "3"),
    HOUSEHOLD_J_PUSH_SCENE_TYPE_THAW("解冻", "4"),
    HOUSEHOLD_J_PUSH_SCENE_TYPE_PASS("审核通过", "5"),
    HOUSEHOLD_J_PUSH_SCENE_TYPE_NOT_PASS("审核未通过", "6"),
    ;
    private String description;
    private String type;

    /**
     * <desc>
     *      物业住户管理中极光推送场景类型枚举无参构造函数
     * </desc>
     * @param
     * @return
     * @author zhangs
     * @createDate 2017/09/22
     */
    HouseHoldJPushSceneTypeEnum() {
    }

    /**
     * <desc>
     *      物业住户管理中极光推送场景类型枚举描述与类型构造函数
     * </desc>
     * @param description 描述
     * @param type 类型
     * @return
     * @author zhangs
     * @createDate 2017/09/22
     */
    HouseHoldJPushSceneTypeEnum(String description, String type) {
        this.description = description;
        this.type = type;
    }

    /**
     * <desc>
     *      获取物业住户管理中极光推送场景类型枚举描述
     * </desc>
     * @param
     * @return String
     * @author zhangs
     * @createDate 2017/09/22
     */
    public String getDescription() {
        return description;
    }

    /**
     * <desc>
     *      获取物业住户管理中极光推送场景类型枚举类型
     * </desc>
     * @param
     * @return String
     * @author zhangs
     * @createDate 2017/09/22
     */
    public String getType() {
        return type;
    }

    /**
     * <desc>
     *      获取枚举的描述
     * </desc>
     * @param type 枚举类型
     * @return 枚举描述
     * @author zhangs
     * @createDate 2017/09/22
     */
    public static String getDescription(String type){
        HouseHoldJPushSceneTypeEnum[] types = HouseHoldJPushSceneTypeEnum.values();
        for(HouseHoldJPushSceneTypeEnum limitCategory : types ){
            if(StringHandlerUtil.compareStrWithOutEmpty(limitCategory.getType(), type)){
                return limitCategory.getDescription();
            }
        }
        return null;
    }
}
